package com.art.sunflower.mapper;

import com.art.sunflower.pojo.Cooperation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface CooperationMapper {
    @Insert("insert into cooperation(id,co_name,co_introduce,url) values(#{id},#{co_name}," +
            "#{co_introduce},#{url})")
    int insert(Cooperation cooperation);

    @Update("update cooperation set id=#{id},co_name=#{coName},co_introduce=#{coIntroduce},url=#{url} where id = #{id}")
    int update(Cooperation cooperation);

    @Delete("delete from cooperation where id = #{id}")
    int delete(int id);

    @Select("select * from cooperation where id=#{id}")
    Cooperation selectOne(int id);

    @Select("select * from cooperation")
    List<Map<String, Object>> listAll();

    @Select("select * from cooperation_view")
    List<Map<String, Object>> listIdName();
}
